//
// UCamera.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class UCamera {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public UCamera(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(UCamera obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_UCamera(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static float getDefLx() {
    return nel3dJNI.UCamera_DefLx_get();
  }

  public static float getDefLy() {
    return nel3dJNI.UCamera_DefLy_get();
  }

  public static float getDefLzNear() {
    return nel3dJNI.UCamera_DefLzNear_get();
  }

  public static float getDefLzFar() {
    return nel3dJNI.UCamera_DefLzFar_get();
  }

  public void setFrustum(CFrustum f) {
    nel3dJNI.UCamera_setFrustum__SWIG_0(swigCPtr, this, CFrustum.getCPtr(f), f);
  }

  public CFrustum getFrustum() {
    return new CFrustum(nel3dJNI.UCamera_getFrustum__SWIG_0(swigCPtr, this), false);
  }

  public void setFrustum(float left, float right, float bottom, float top, float znear, float zfar, boolean perspective) {
    nel3dJNI.UCamera_setFrustum__SWIG_1(swigCPtr, this, left, right, bottom, top, znear, zfar, perspective);
  }

  public void setFrustum(float left, float right, float bottom, float top, float znear, float zfar) {
    nel3dJNI.UCamera_setFrustum__SWIG_2(swigCPtr, this, left, right, bottom, top, znear, zfar);
  }

  public void setFrustum(float width, float height, float znear, float zfar, boolean perspective) {
    nel3dJNI.UCamera_setFrustum__SWIG_3(swigCPtr, this, width, height, znear, zfar, perspective);
  }

  public void setFrustum(float width, float height, float znear, float zfar) {
    nel3dJNI.UCamera_setFrustum__SWIG_4(swigCPtr, this, width, height, znear, zfar);
  }

  public void getFrustum(SWIGTYPE_p_float left, SWIGTYPE_p_float right, SWIGTYPE_p_float bottom, SWIGTYPE_p_float top, SWIGTYPE_p_float znear, SWIGTYPE_p_float zfar) {
    nel3dJNI.UCamera_getFrustum__SWIG_1(swigCPtr, this, SWIGTYPE_p_float.getCPtr(left), SWIGTYPE_p_float.getCPtr(right), SWIGTYPE_p_float.getCPtr(bottom), SWIGTYPE_p_float.getCPtr(top), SWIGTYPE_p_float.getCPtr(znear), SWIGTYPE_p_float.getCPtr(zfar));
  }

  public boolean isOrtho() {
    return nel3dJNI.UCamera_isOrtho(swigCPtr, this);
  }

  public boolean isPerspective() {
    return nel3dJNI.UCamera_isPerspective(swigCPtr, this);
  }

  public void setPerspective(float fov, float aspectRatio, float znear, float zfar) {
    nel3dJNI.UCamera_setPerspective(swigCPtr, this, fov, aspectRatio, znear, zfar);
  }

  public void buildCameraPyramid(SWIGTYPE_p_std__vectorT_NLMISC__CPlane_t pyramid, boolean useWorldMatrix) {
    nel3dJNI.UCamera_buildCameraPyramid(swigCPtr, this, SWIGTYPE_p_std__vectorT_NLMISC__CPlane_t.getCPtr(pyramid), useWorldMatrix);
  }

  public void buildCameraPyramidCorners(Vector_CVector pyramidCorners, boolean useWorldMatrix) {
    nel3dJNI.UCamera_buildCameraPyramidCorners(swigCPtr, this, Vector_CVector.getCPtr(pyramidCorners), pyramidCorners, useWorldMatrix);
  }

  public UCamera() {
    this(nel3dJNI.new_UCamera__SWIG_0(), true);
  }

  public UCamera(CCamera object) {
    this(nel3dJNI.new_UCamera__SWIG_1(CCamera.getCPtr(object), object), true);
  }

  public void attach(CCamera object) {
    nel3dJNI.UCamera_attach(swigCPtr, this, CCamera.getCPtr(object), object);
  }

  public void detach() {
    nel3dJNI.UCamera_detach(swigCPtr, this);
  }

  public boolean empty() {
    return nel3dJNI.UCamera_empty(swigCPtr, this);
  }

  public CCamera getObjectPtr() {
    long cPtr = nel3dJNI.UCamera_getObjectPtr(swigCPtr, this);
    return (cPtr == 0) ? null : new CCamera(cPtr, false);
  }

}
